<!DOCTYPE html>

































































<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="shortcut icon" type="image/x-icon" href="../../../favicon.ico" />
<title>Multiple APK Support | Android Developers</title>
<link href="../../../assets/android-developer-docs-devguide.css" rel="stylesheet" type="text/css" />
<script src="../../../assets/search_autocomplete.js" type="text/javascript"></script>
<script src="../../../assets/jquery-resizable.min.js" type="text/javascript"></script>
<script src="../../../assets/android-developer-docs.js" type="text/javascript"></script>
<script src="../../../assets/prettify.js" type="text/javascript"></script>
<script type="text/javascript">
  setToRoot("../../../");
</script>
<noscript>
  <style type="text/css">
    html,body{overflow:auto;}
    #body-content{position:relative; top:0;}
    #doc-content{overflow:visible;border-left:3px solid #666;}
    #side-nav{padding:0;}
    #side-nav .toggle-list ul {display:block;}
    #resize-packages-nav{border-bottom:3px solid #666;}
  </style>
</noscript>
</head>
<body class="gc-documentation">

  <div id="header">
      <div id="headerLeft">
          <a href="../../../index.html" tabindex="-1"><img
              src="../../../assets/images/bg_logo.png" alt="Android Developers" /></a>
          <ul id="header-tabs" class="guide">
    
	<li id="home-link"><a href="../../../offline.html">
	
		<span class="en">Home</span>
		<span style="display:none" class="de">Startseite</span>
		<span style="display:none" class="es"></span>
		<span style="display:none" class="fr"></span>
		<span style="display:none" class="it"></span>
		<span style="display:none" class="ja">ホーム</span>
		<span style="display:none" class="zh-CN">主页</span>
		<span style="display:none" class="zh-TW">首頁</span>
	
	</a></li>
	<li id="sdk-link"><a href="../../../sdk/index.html">
		<span class="en">SDK</span>
	</a></li>
	<li id="guide-link"><a href="../../../guide/index.html" onClick="return loadLast('guide')">
	
		<span class="en">Dev Guide</span>
		<span style="display:none" class="de">Handbuch</span>
		<span style="display:none" class="es">Guía</span>
		<span style="display:none" class="fr">Guide</span>
		<span style="display:none" class="it">Guida</span>
		<span style="display:none" class="ja">開発ガイド</span>
		<span style="display:none" class="zh-CN">开发人员指南</span>
		<span style="display:none" class="zh-TW">開發指南</span>
	
	</a></li>
	<li id="reference-link"><a href="../../../reference/packages.html" onClick="return loadLast('reference')">
	
		<span class="en">Reference</span>
		<span style="display:none" class="de">Referenz</span>
		<span style="display:none" class="es">Referencia</span>
		<span style="display:none" class="fr">Référence</span>
		<span style="display:none" class="it">Riferimento</span>
		<span style="display:none" class="ja">リファレンス</span>
		<span style="display:none" class="zh-CN">参考</span>
		<span style="display:none" class="zh-TW">參考資料</span>
	
	</a></li>
	<li id="resources-link"><a href="../../../resources/index.html" onClick="return loadLast('resources')">
	
		<span class="en">Resources</span>
		<span style="display:none" class="de"></span>
		<span style="display:none" class="es"></span>
		<span style="display:none" class="fr"></span>
		<span style="display:none" class="it"></span>
    		<span style="display:none" class="ja"></span>
		<span style="display:none" class="zh-CN"></span>
		<span style="display:none" class="zh-TW"></span>
	
	</a></li>
	<li id="videos-link"><a href="../../../videos/index.html" onClick="return loadLast('videos')">
	
		<span class="en">Videos</span>
		<span style="display:none" class="de"></span>
		<span style="display:none" class="es"></span>
		<span style="display:none" class="fr"></span>
		<span style="display:none" class="it"></span>
		<span style="display:none" class="ja">ビデオ</span>
		<span style="display:none" class="zh-CN"></span>
		<span style="display:none" class="zh-TW"></span>
	
	</a></li>
	<li><a href="http://android-developers.blogspot.com" onClick="return requestAppendHL(this.href)">
	
		<span class="en">Blog</span>
		<span style="display:none" class="de"></span>
		<span style="display:none" class="es"></span>
		<span style="display:none" class="fr"></span>
		<span style="display:none" class="it"></span>
		<span style="display:none" class="ja">ブログ</span>
		<span style="display:none" class="zh-CN">博客</span>
		<span style="display:none" class="zh-TW">網誌</span>
	
	</a></li>


     
</ul>
     
      </div>
      <div id="headerRight">
          <div id="headerLinks">
          
          <a href="http://www.android.com">Android.com</a>
          </div>
  <div id="search" >
      <div id="searchForm">
          <form accept-charset="utf-8" class="gsc-search-box" 
                onsubmit="return submit_search()">
            <table class="gsc-search-box" cellpadding="0" cellspacing="0"><tbody>
                <tr>
                  <td class="gsc-input">
                    <input id="search_autocomplete" class="gsc-input" type="text" size="33" autocomplete="off"
                      title="search developer docs" name="q"
                      value="search developer docs"
                      onFocus="search_focus_changed(this, true)"
                      onBlur="search_focus_changed(this, false)"
                      onkeydown="return search_changed(event, true, '../../../')"
                      onkeyup="return search_changed(event, false, '../../../')" />
                  <div id="search_filtered_div" class="no-display">
                      <table id="search_filtered" cellspacing=0>
                      </table>
                  </div>
                  </td>
                  <td class="gsc-search-button">
                    <input type="submit" value="Search" title="search" id="search-button" class="gsc-search-button" />
                  </td>
                  <td class="gsc-clear-button">
                    <div title="clear results" class="gsc-clear-button">&nbsp;</div>
                  </td>
                </tr></tbody>
              </table>
          </form>
      </div><!-- searchForm -->
  </div><!-- search -->
      </div><!-- headerRight -->
      <script type="text/javascript">
        <!--  
        changeTabLang(getLangPref());
        //-->
      </script>
  </div><!-- header -->

  <div class="g-section g-tpl-240" id="body-content">
    <div class="g-unit g-first" id="side-nav">
      <div id="devdoc-nav">
<ul>

  <li>
    <h2><span class="en">Android Basics</span>
        <span class="de" style="display:none">Einführung in Android</span>
        <span class="es" style="display:none">Información básica sobre Android</span>
        <span class="fr" style="display:none">Présentation d'Android</span>
        <span class="it" style="display:none">Nozioni di base su Android</span>
        <span class="ja" style="display:none">Android の基本</span>
        <span class="zh-CN" style="display:none">Android 基础知识</span>
        <span class="zh-TW" style="display:none">Android 簡介</span>
    </h2>
    <ul>
      <li><a href="../../../guide/basics/what-is-android.html">
        <span class="en">What Is Android?</span>
        <span class="de" style="display:none">Was ist Android?</span>
        <span class="es" style="display:none">¿Qué es Android?</span>
        <span class="fr" style="display:none">Qu'est-ce qu'Android&nbsp;?</span>
        <span class="it" style="display:none">Che cos'è Android?</span>
        <span class="ja" style="display:none">Android とは</span>
        <span class="zh-CN" style="display:none">Android 是什么？</span>
        <span class="zh-TW" style="display:none">什麼是 Android？</span>
          </a></li>
      <li><a href="../../../guide/topics/fundamentals.html">
        <span class="en">Application Fundamentals</span>
        <span class="de" style="display:none">Anwendungsgrundlagen</span>
        <span class="es" style="display:none">Fundamentos de las aplicaciones</span>
        <span class="fr" style="display:none">Principes de base des applications</span>
        <span class="it" style="display:none">Concetti fondamentali sulle applicazioni</span>
        <span class="ja" style="display:none">開発の基礎</span>
        <span class="zh-CN" style="display:none">应用程序基础</span>
        <span class="zh-TW" style="display:none">應用程式基本原理</span>
      </a></li>

  <!--  <li><a style="color:gray;">The Android SDK</a></li> -->
  <!--  <li><a style="color:gray;">Walkthrough for Developers</a></li> -->
      <!-- quick overview of what it's like to develop on Android -->
    </ul>
  </li>

  <li>
    <h2>
      <span class="en">Framework Topics</span>
      <span class="de" style="display:none">Framework-Themen</span>
      <span class="es" style="display:none">Temas sobre el framework</span>
      <span class="fr" style="display:none">Thèmes relatifs au framework</span>
      <span class="it" style="display:none">Argomenti relativi al framework</span>
      <span class="ja" style="display:none">フレームワーク トピック</span>
      <span class="zh-CN" style="display:none">框架主题</span>
      <span class="zh-TW" style="display:none">架構主題</span>
    </h2>
    <ul>
      <li class="toggle-list">
        <div><a href="../../../guide/topics/fundamentals/activities.html">
          <span class="en">Activities</span>
        </a></div>
        <ul>
          <li><a href="../../../guide/topics/fundamentals/fragments.html">
            <span class="en">Fragments</span>
          </a></li>
          <li><a href="../../../guide/topics/fundamentals/loaders.html">
            <span class="en">Loaders</span>
          </a></li>
          <li><a href="../../../guide/topics/fundamentals/tasks-and-back-stack.html">
            <span class="en">Tasks and Back Stack</span></a></li>
        </ul>
      </li>
      <li class="toggle-list">
        <div><a href="../../../guide/topics/fundamentals/services.html">
          <span class="en">Services</span>
        </a></div>
        <ul>
          <li><a href="../../../guide/topics/fundamentals/bound-services.html">
            <span class="en">Bound Services</span>
          </a></li>
        </ul>
      </li>
      <li><a href="../../../guide/topics/providers/content-providers.html">
            <span class="en">Content Providers</span>
          </a></li>
      <li><a href="../../../guide/topics/intents/intents-filters.html">
            <span class="en">Intents and Intent Filters</span>
          </a></li>
      <li><a href="../../../guide/topics/fundamentals/processes-and-threads.html">
            <span class="en">Processes and Threads</span>
          </a></li>
    </ul>


    <ul>
      <li class="toggle-list">
        <div><a href="../../../guide/topics/ui/index.html">
            <span class="en">User Interface</span>
          </a></div>
        <ul>
          <li><a href="../../../guide/topics/ui/declaring-layout.html">
               <span class="en">XML Layouts</span>
              </a></li>
          <li><a href="../../../guide/topics/ui/ui-events.html">
                <span class="en">Input Events</span>
              </a></li>
          <li><a href="../../../guide/topics/ui/menus.html">
               <span class="en">Menus</span>
              </a></li>
          <li><a href="../../../guide/topics/ui/actionbar.html">
               <span class="en">Action Bar</span>
              </a></li>
          <li><a href="../../../guide/topics/ui/dialogs.html">
                <span class="en">Dialogs</span>
              </a></li>
          <li class="toggle-list">
            <div><a href="../../../guide/topics/ui/notifiers/index.html">
                <span class="en">Notifications</span>
            </a></div>
            <ul>
              <li><a href="../../../guide/topics/ui/notifiers/toasts.html">
                <span class="en">Toast Notifications</span>
              </a></li>
              <li><a href="../../../guide/topics/ui/notifiers/notifications.html">
                <span class="en">Status Bar Notifications</span>
              </a></li>
            </ul>
          </li>
          <li><a href="../../../guide/topics/ui/drag-drop.html">
                <span class="en">Drag and Drop</span>
              </a></li>
          <li><a href="../../../guide/topics/ui/themes.html">
                <span class="en">Styles and Themes</span>
              </a></li>
          <li><a href="../../../guide/topics/ui/custom-components.html">
                <span class="en">Custom Components</span>
              </a></li>
          <li><a href="../../../guide/topics/ui/binding.html">
                <span class="en">Binding to Data with AdapterView</span>
              </a></li>
          <li><a href="../../../guide/topics/ui/layout-objects.html">
                <span class="en">Common Layout Objects</span>
              </a></li>
          <li><a href="../../../guide/topics/ui/how-android-draws.html">
                <span class="en">How Android Draws Views</span>
              </a></li>
        </ul>
      </li><!-- end of User Interface -->

      <li class="toggle-list">
        <div><a href="../../../guide/topics/resources/index.html">
               <span class="en">Application Resources</span>
             </a></div>
        <ul>
          <li><a href="../../../guide/topics/resources/providing-resources.html">
                <span class="en">Providing Resources</span>
              </a></li>
          <li><a href="../../../guide/topics/resources/accessing-resources.html">
                <span class="en">Accessing Resources</span>
              </a></li>
          <li><a href="../../../guide/topics/resources/runtime-changes.html">
                <span class="en">Handling Runtime Changes</span>
              </a></li>
          <li><a href="../../../guide/topics/resources/localization.html">
                <span class="en">Localization</span>
              </a></li>
          <li class="toggle-list">
            <div><a href="../../../guide/topics/resources/available-resources.html">
              <span class="en">Resource Types</span>
            </a></div>
            <ul>
              <li><a href="../../../guide/topics/resources/animation-resource.html">Animation</a></li>
              <li><a href="../../../guide/topics/resources/color-list-resource.html">Color State List</a></li>
              <li><a href="../../../guide/topics/resources/drawable-resource.html">Drawable</a></li>
              <li><a href="../../../guide/topics/resources/layout-resource.html">Layout</a></li>
              <li><a href="../../../guide/topics/resources/menu-resource.html">Menu</a></li>
              <li><a href="../../../guide/topics/resources/string-resource.html">String</a></li>
              <li><a href="../../../guide/topics/resources/style-resource.html">Style</a></li>
              <li><a href="../../../guide/topics/resources/more-resources.html">More Types</a></li>
            </ul>
          </li><!-- end of resource types -->
        </ul>
      </li><!-- end of app resources -->
      <li class="toggle-list">
        <div><a href="../../../guide/topics/data/data-storage.html">
            <span class="en">Data Storage</span>
          </a></div>
          <ul>
            <li><a href="../../../guide/topics/data/backup.html">
                <span class="en">Data Backup</span>
              </a>
            </li>
          </ul>
      </li>
      <li><a href="../../../guide/topics/security/security.html">
            <span class="en">Security and Permissions</span>
          </a></li>
      <li class="toggle-list">
        <div><a href="../../../guide/topics/manifest/manifest-intro.html">
          <span class="en">The AndroidManifest.xml File</span>
        </a></div>
        <ul>
          <li><a href="../../../guide/topics/manifest/action-element.html">&lt;action&gt;</a></li>
          <li><a href="../../../guide/topics/manifest/activity-element.html">&lt;activity&gt;</a></li>
          <li><a href="../../../guide/topics/manifest/activity-alias-element.html">&lt;activity-alias&gt;</a></li>
          <li><a href="../../../guide/topics/manifest/application-element.html">&lt;application&gt;</a></li>
          <li><a href="../../../guide/topics/manifest/category-element.html">&lt;category&gt;</a></li>
          <li><a href="../../../guide/topics/manifest/compatible-screens-element.html">&lt;compatible-screens&gt;</a></li>
          <li><a href="../../../guide/topics/manifest/data-element.html">&lt;data&gt;</a></li>
          <li><a href="../../../guide/topics/manifest/grant-uri-permission-element.html">&lt;grant-uri-permission&gt;</a></li>
          <li><a href="../../../guide/topics/manifest/instrumentation-element.html">&lt;instrumentation&gt;</a></li>
          <li><a href="../../../guide/topics/manifest/intent-filter-element.html">&lt;intent-filter&gt;</a></li>
          <li><a href="../../../guide/topics/manifest/manifest-element.html">&lt;manifest&gt;</a></li>
          <li><a href="../../../guide/topics/manifest/meta-data-element.html">&lt;meta-data&gt;</a></li>
          <li><a href="../../../guide/topics/manifest/path-permission-element.html">&lt;path-permission&gt;</a></li>
          <li><a href="../../../guide/topics/manifest/permission-element.html">&lt;permission&gt;</a></li>
          <li><a href="../../../guide/topics/manifest/permission-group-element.html">&lt;permission-group&gt;</a></li>
          <li><a href="../../../guide/topics/manifest/permission-tree-element.html">&lt;permission-tree&gt;</a></li>
          <li><a href="../../../guide/topics/manifest/provider-element.html">&lt;provider&gt;</a></li>
          <li><a href="../../../guide/topics/manifest/receiver-element.html">&lt;receiver&gt;</a></li>
          <li><a href="../../../guide/topics/manifest/service-element.html">&lt;service&gt;</a></li>
          <li><a href="../../../guide/topics/manifest/supports-gl-texture-element.html">&lt;supports-gl-texture&gt;</a></li>
          <li><a href="../../../guide/topics/manifest/supports-screens-element.html">&lt;supports-screens&gt;</a></li><!-- ##api level 4## -->
          <li><a href="../../../guide/topics/manifest/uses-configuration-element.html">&lt;uses-configuration&gt;</a></li>
          <li><a href="../../../guide/topics/manifest/uses-feature-element.html">&lt;uses-feature&gt;</a></li> <!-- ##api level 4## -->
          <li><a href="../../../guide/topics/manifest/uses-library-element.html">&lt;uses-library&gt;</a></li>
          <li><a href="../../../guide/topics/manifest/uses-permission-element.html">&lt;uses-permission&gt;</a></li>
          <li><a href="../../../guide/topics/manifest/uses-sdk-element.html">&lt;uses-sdk&gt;</a></li>
        </ul>
      </li><!-- end of the manifest file -->
    </ul>

    <ul>
    <li class="toggle-list">
        <div><a href="../../../guide/topics/graphics/index.html">
            <span class="en">Graphics</span>
          </a><span class="new-child">new!</span></div>
        <ul>
          <li><a href="../../../guide/topics/graphics/2d-graphics.html">
              <span class="en">Canvas and Drawables</span></a></li>
          <li><a href="../../../guide/topics/graphics/hardware-accel.html">
              <span class="en">Hardware Acceleration</span></a>
            <span class="new">new!</span></li>
          <li><a href="../../../guide/topics/graphics/opengl.html">
              <span class="en">OpenGL</span>
            </a><span class="new">updated</span></li>
        </ul>
      </li>
      <li class="toggle-list">
        <div><a href="../../../guide/topics/graphics/animation.html">
            <span class="en">Animation</span>
          </a></div>
        <ul>
          <li><a href="../../../guide/topics/graphics/prop-animation.html">
              <span class="en">Property Animation</span></a></li>
          <li><a href="../../../guide/topics/graphics/view-animation.html">
              <span class="en">View Animation</span></a></li>
          <li><a href="../../../guide/topics/graphics/drawable-animation.html">
              <span class="en">Drawable Animation</span></a></li>
        </ul>
      </li>
      <li class="toggle-list">
	        <div><a href="../../../guide/topics/renderscript/index.html">
	            <span class="en">RenderScript</span>
	          </a></div>
	        <ul>
	          <li><a href="../../../guide/topics/renderscript/graphics.html">
	                <span class="en">Graphics</span>
	              </a>
	          </li>
	          <li><a href="../../../guide/topics/renderscript/compute.html">
	                <span class="en">Compute</span>
	              </a>
	          </li>
	        </ul>
  	  </li>

      <li class="toggle-list">
          <div><a href="../../../guide/topics/media/index.html">
            <span class="en">Multimedia and Camera</span>
          </a><span class="new">updated</span></div>
          <ul>
            <li><a href="../../../guide/topics/media/mediaplayer.html">
                  <span class="en">Media Playback</span></a>
                </li>
            <li><a href="../../../guide/topics/media/jetplayer.html">
                  <span class="en">JetPlayer</span></a>
                </li>
            <li><a href="../../../guide/topics/media/camera.html">
                  <span class="en">Camera</span></a>
                  <span class="new">new!</span>
                </li>
            <li><a href="../../../guide/topics/media/audio-capture.html">
                  <span class="en">Audio Capture</span></a>
                </li>
          </ul>
      </li>
      <li>
        <a href="../../../guide/topics/clipboard/copy-paste.html">
            <span class="en">Copy and Paste</span>
        </a></li>
  <!--<li class="toggle-list">
        <div><a style="color:gray;">Sensors</a></div>
          <ul>
            <li><a style="color:gray;">Camera</a></li>
            <li><a style="color:gray;">Compass</a></li>
            <li><a style="color:gray;">Accelerometer</a></li>
          </ul>
      </li> -->
      <li class="toggle-list">
        <div><a href="../../../guide/topics/location/index.html">
               <span class="en">Location and Maps</span>
             </a></div>
        <ul>
          <li><a href="../../../guide/topics/location/obtaining-user-location.html">
                <span class="en">Obtaining User Location</span>
              </a></li>
        </ul>
      </li>
  <!--<li class="toggle-list">
        <div><a style="color:gray;">Wireless Controls</a></div>
          <ul>
            <li><a style="color:gray;">Wi-Fi</a></li>
          </ul>
      </li> -->
  <!--<li><a style="color:gray;">Localization</a></li>  -->
      <li><a href="../../../guide/topics/appwidgets/index.html">
            <span class="en">App Widgets</span></a>
          </li>
      <li><a href="../../../guide/topics/wireless/bluetooth.html">
            <span class="en">Bluetooth</span></a>
          </li>
      <li><a href="../../../guide/topics/nfc/index.html">
            <span class="en">Near Field Communication</span>
          </a></li>
      <li class="toggle-list">
          <div><a href="../../../guide/topics/usb/index.html">
            <span class="en">USB</span></a>
          </div>
            <ul>
              <li><a href="../../../guide/topics/usb/accessory.html">Accessory</a></li>
              <li><a href="../../../guide/topics/usb/host.html">Host</a></li>
              <li><a href="../../../guide/topics/usb/adk.html">Open Accessory Dev Kit</a></li>
            </ul>
          </li>

       <li><a href="../../../guide/topics/network/sip.html">
            <span class="en">Session Initiation Protocol</span>
          </a></li>
      <li class="toggle-list">
        <div><a href="../../../guide/topics/search/index.html">
            <span class="en">Search</span>
          </a></div>
          <ul>
            <li><a href="../../../guide/topics/search/search-dialog.html">Creating a Search Interface</a></li>
            <li><a href="../../../guide/topics/search/adding-recent-query-suggestions.html">Adding Recent Query Suggestions</a></li>
            <li><a href="../../../guide/topics/search/adding-custom-suggestions.html">Adding Custom Suggestions</a></li>
            <li><a href="../../../guide/topics/search/searchable-config.html">Searchable Configuration</a></li>
          </ul>
      </li>
      <li><a href="../../../guide/topics/admin/device-admin.html">
            <span class="en">Device Administration</span></a>
      </li>
      <li class="toggle-list">
           <div>
                <a href="../../../guide/topics/testing/index.html">
                   <span class="en">Testing</span>
               </a>
           </div>
           <ul>
              <li>
                <a href="../../../guide/topics/testing/testing_android.html">
                <span class="en">Testing Fundamentals</span></a>
              </li>
              <li>
                <a href="../../../guide/topics/testing/activity_testing.html">
                <span class="en">Activity Testing</span></a>
              </li>
              <li>
                <a href="../../../guide/topics/testing/contentprovider_testing.html">
                <span class="en">Content Provider Testing</span></a>
              </li>
              <li>
                <a href="../../../guide/topics/testing/service_testing.html">
                <span class="en">Service Testing</span></a>
              </li>
              <li>
                <a href="../../../guide/topics/testing/what_to_test.html">
                <span class="en">What To Test</span></a>
              </li>
           </ul>
      </li>
    </ul>
  </li>

  <li>
    <h2>
      <span class="en">Android Market Topics</span>
    </h2>
    <ul>
      <li><a href="../../../guide/publishing/licensing.html">
          <span class="en">Application Licensing</span></a>
      </li>
      <li class="toggle-list">
        <div><a href="../../../guide/market/billing/index.html">
            <span class="en">In-app Billing</span></a>
        </div>
        <ul>
          <li><a href="../../../guide/market/billing/billing_overview.html">
              <span class="en">In-app Billing Overview</span></a>
          </li>
          <li><a href="../../../guide/market/billing/billing_integrate.html">
              <span class="en">Implementing In-app Billing</span></a>
          </li>
          <li><a href="../../../guide/market/billing/billing_best_practices.html">
              <span class="en">Security and Design</span></a>
          </li>
          <li><a href="../../../guide/market/billing/billing_testing.html">
              <span class="en">Testing In-app Billing</span></a>
          </li>
          <li><a href="../../../guide/market/billing/billing_admin.html">
              <span class="en">Administering In-app Billing</span></a>
          </li>
          <li><a href="../../../guide/market/billing/billing_reference.html">
              <span class="en">In-app Billing Reference</span></a>
          </li>
        </ul>
      </li>
      <li><a href="../../../guide/appendix/market-filters.html">
          <span class="en">Market Filters</span></a>
      </li>
      <li><a href="../../../guide/market/publishing/multiple-apks.html">
          <span class="en">Multiple APK Support</span></a>
      </li>
    </ul>
  </li>


  <li>
    <h2><span class="en">Developing</span>
               <span class="de" style="display:none">Entwicklung</span>
               <span class="es" style="display:none">Desarrollo</span>
               <span class="fr" style="display:none">Développement</span>
               <span class="it" style="display:none">Sviluppo</span>
               <span class="ja" style="display:none">開発</span>
               <span class="zh-CN" style="display:none">开发</span>
               <span class="zh-TW" style="display:none">開發</span>
    </h2>
    <ul>
  <!--<li><a href="">Developing for Android</a></li>
      signing, upgrading, selecting a package name, select device profile, touch, trackball, dpad available, etc. -->
      <li>
        <a href="../../../guide/developing/index.html">
        <span class="en">Introduction</span></a>
      </li>

      <li class="toggle-list">
        <div>
           <a href="../../../guide/developing/devices/index.html">
                <span class="en">Managing Virtual Devices</span>
            </a>
        </div>
        <ul>
          <li>
            <a href="../../../guide/developing/devices/managing-avds.html">
              <span class="en">With AVD Manager</span>
            </a>
          </li>
          <li>
            <a href="../../../guide/developing/devices/managing-avds-cmdline.html">
              <span class="en">From the Command Line</span>
            </a>
          </li>
          <li>
           <a href="../../../guide/developing/devices/emulator.html">
                <span class="en">Using the Android Emulator</span>
            </a>
          </li>
        </ul>
      </li>
      <li>
        <a href="../../../guide/developing/device.html">
          <span class="en">Using Hardware Devices</span>
        </a>
      </li>

      <li class="toggle-list">
        <div>
          <a href="../../../guide/developing/projects/index.html">
            <span class="en">Managing Projects</span>
          </a>
        </div>
        <ul>
          <li>
            <a href="../../../guide/developing/projects/projects-eclipse.html">
              <span class="en">From Eclipse with ADT</span>
            </a>
          </li>
          <li>
            <a href="../../../guide/developing/projects/projects-cmdline.html">
                <span class="en">From the Command Line</span>
            </a>
          </li>
        </ul>
      </li>

      <li class="toggle-list">
        <div>
          <a href="../../../guide/developing/building/index.html">
            <span class="en">Building and Running</span>
          </a>
        </div>
        <ul>
          <li><a href="../../../guide/developing/building/building-eclipse.html">
            <span class="en">From Eclipse with ADT</span>
          </a></li>
          <li><a href="../../../guide/developing/building/building-cmdline.html">
            <span class="en">From the Command Line</span></a></li>
        </ul>
      </li>

      <li class="toggle-list">
        <div>
          <a href="../../../guide/developing/debugging/index.html">
            <span class="en">Debugging</span>
          </a>
        </div>
        <ul>
          <li>
            <a href="../../../guide/developing/debugging/debugging-projects.html">
                <span class="en">From Eclipse with ADT</span>
            </a>
          </li>
          <li>
            <a href="../../../guide/developing/debugging/debugging-projects-cmdline.html">
                <span class="en">From Other IDEs</span>
            </a>
          </li>
          <li>
            <a href="../../../guide/developing/debugging/ddms.html">
              <span class="en">Using DDMS</span>
            </a>
          </li>
          <li>
            <a href="../../../guide/developing/debugging/debugging-log.html">
                <span class="en">Reading and Writing Logs</span>
            </a>
          </li>
          <li>
            <a href="../../../guide/developing/debugging/debugging-ui.html">
                <span class="en">Debugging and Profiling UIs</span>
            </a>
          </li>
          <li>
            <a href="../../../guide/developing/debugging/debugging-tracing.html">
                <span class="en">Profiling with Traceview and dmtracedump</span>
            </a>
          </li>
          <li>
            <a href="../../../guide/developing/debugging/debugging-devtools.html">
                <span class="en">Using the Dev Tools App</span>
            </a>
          </li>
        </ul>
      </li>

      <li class="toggle-list">
           <div>
                <a href="../../../guide/developing/testing/index.html">
                   <span class="en">Testing</span>
               </a>
           </div>
           <ul>
              <li>
                <a href="../../../guide/developing/testing/testing_eclipse.html">
                  <span class="en">From Eclipse with ADT</span>
                </a>
              </li>

              <li>
                <a href="../../../guide/developing/testing/testing_otheride.html">
                  <span class="en">From Other IDEs</span>
                </a>
              </li>
           </ul>
         </li>

         <li class="toggle-list">
        <div><a href="../../../guide/developing/tools/index.html">
            <span class="en">Tools</span>
          </a></div>
        <ul>
          <li><a href="../../../guide/developing/tools/adb.html">adb</a></li>
          <li><a href="../../../guide/developing/tools/adt.html">ADT</a></li>
          <li><a href="../../../guide/developing/tools/android.html">android</a></li>
          <li><a href="../../../guide/developing/tools/bmgr.html">bmgr</a>
          <li><a href="../../../guide/developing/tools/dmtracedump.html">dmtracedump</a></li>
          <li><a href="../../../guide/developing/tools/draw9patch.html">Draw
          9-Patch</a></li>
          <li><a href="../../../guide/developing/tools/emulator.html">Emulator</a></li>
          <li><a href="../../../guide/developing/tools/etc1tool.html">etc1tool</a></li>
          <li><a href="../../../guide/developing/tools/hierarchy-viewer.html">Hierarchy Viewer</a></li>
          <li><a href="../../../guide/developing/tools/hprof-conv.html">hprof-conv</a></li>
          <li><a href="../../../guide/developing/tools/layoutopt.html">layoutopt</a></li>
          <li><a href="../../../guide/developing/tools/logcat.html">logcat</a></li>
          <li><a href="../../../guide/developing/tools/mksdcard.html">mksdcard</a></li>
          <li><a href="../../../guide/developing/tools/monkey.html">Monkey</a></li>
          <li class="toggle-list">
            <div><a href="../../../guide/developing/tools/monkeyrunner_concepts.html">
              <span class="en">monkeyrunner</span>
            </a></div>
            <ul>
              <li><a href="../../../guide/developing/tools/MonkeyDevice.html">
                <span class="en">MonkeyDevice</span>
                </a></li>
              <li><a href="../../../guide/developing/tools/MonkeyImage.html">
                <span class="en">MonkeyImage</span>
                </a></li>
              <li><a href="../../../guide/developing/tools/MonkeyRunner.html">
                <span class="en">MonkeyRunner</span>
                </a></li>
            </ul>
          </li>
          <li><a href="../../../guide/developing/tools/proguard.html">ProGuard</a></li>
          <li><a href="../../../guide/developing/tools/adb.html#sqlite">sqlite3</a></li>
          <li><a href="../../../guide/developing/tools/traceview.html">Traceview</a></li>
          <li><a href="../../../guide/developing/tools/zipalign.html">zipalign</a></li>
        </ul>
      </li>
    </ul>
  </li>

  <li>
    <h2><span class="en">Publishing</span>
        <span class="de" style="display:none">Veröffentlichung</span>
        <span class="es" style="display:none">Publicación</span>
        <span class="fr" style="display:none">Publication</span>
        <span class="it" style="display:none">Pubblicazione</span>
        <span class="ja" style="display:none">公開</span>
        <span class="zh-CN" style="display:none">发布</span>
        <span class="zh-TW" style="display:none">發佈</span>
    </h2>
    <ul>
      <li><a href="../../../guide/publishing/app-signing.html">
            <span class="en">Signing Your Applications</span>
            <span class="de" style="display:none">Signieren Ihrer Anwendungen</span>
            <span class="es" style="display:none">Firma de aplicaciones</span>
            <span class="fr" style="display:none">Attribution de votre signature <br />à vos applications</span>
            <span class="it" style="display:none">Firma delle applicazioni</span>
            <span class="ja" style="display:none">アプリケーションへの署名</span>
            <span class="zh-CN" style="display:none">应用程序签名</span>
            <span class="zh-TW" style="display:none">簽署應用程式</span>
          </a></li>
      <li><a href="../../../guide/publishing/versioning.html">
            <span class="en">Versioning Your Applications</span>
            <span class="de" style="display:none">Versionsverwaltung für Ihre <br />Anwendungen</span>
            <span class="es" style="display:none">Versiones de las aplicaciones</span>
            <span class="fr" style="display:none">Attribution d'une version à vos applications</span>
            <span class="it" style="display:none">Controllo versioni delle applicazioni</span>
            <span class="ja" style="display:none">アプリケーションのバージョニング</span>
            <span class="zh-CN" style="display:none">应用程序版本控制</span>
            <span class="zh-TW" style="display:none">應用程式版本設定</span>
          </a></li>
      <li><a href="../../../guide/publishing/preparing.html">
            <span class="en">Preparing to Publish</span>
            <span class="de" style="display:none">Vorbereitung auf die Veröffentlichung</span>
            <span class="es" style="display:none">Publicación de aplicaciones</span>
            <span class="fr" style="display:none">Préparation à la publication</span>
            <span class="it" style="display:none">Preparativi per la pubblicazione</span>
            <span class="ja" style="display:none">公開の準備</span>
            <span class="zh-CN" style="display:none">准备发布</span>
            <span class="zh-TW" style="display:none">準備發佈</span>
          </a></li>
      <li><a href="../../../guide/publishing/publishing.html">
            <span class="en">Publishing on Android Market</span>
          </a></li>
    </ul>
  </li>

  <li>
    <h2><span class="en">Best Practices</span>
               <span class="de" style="display:none">Bewährte Verfahren</span>
               <span class="es" style="display:none">Prácticas recomendadas</span>
               <span class="fr" style="display:none">Meilleures pratiques</span>
               <span class="it" style="display:none">Best practice</span>
               <span class="ja" style="display:none">ベスト プラクティス</span>
               <span class="zh-CN" style="display:none">最佳实践</span>
               <span class="zh-TW" style="display:none">最佳實務</span>
    </h2>
    <ul>
      <li><a href="../../../guide/practices/compatibility.html">
            <span class="en">Compatibility</span>
          </a></li>
      <li class="toggle-list">
        <div><a href="../../../guide/practices/screens_support.html">
          <span class="en">Supporting Multiple Screens</span>
        </a></div>
        <ul>
          <li><a href="../../../guide/practices/screens-distribution.html">
            <span class="en">Distributing to Specific Screens</span>
          </a></li>
          <li><a href="../../../guide/practices/screen-compat-mode.html">
            <span class="en">Screen Compatibility Mode</span>
          </a></li>
          <li><a href="../../../guide/practices/screens-support-1.5.html">
            <span class="en">Strategies for Android 1.5</span>
          </a></li>
        </ul>
      </li>
      <li><a href="../../../guide/practices/optimizing-for-3.0.html">
            <span class="en">Optimizing Apps for Android 3.0</span>
          </a></li>
      <li class="toggle-list">
        <div><a href="../../../guide/practices/ui_guidelines/index.html">
               <span class="en">UI Guidelines</span>
             </a></div>
        <ul>
          <li class="toggle-list">
            <div><a href="../../../guide/practices/ui_guidelines/icon_design.html">
                   <span class="en">Icon Design <span class="new">updated</span></span>
                 </a></div>
            <ul>
              <li><a href="../../../guide/practices/ui_guidelines/icon_design_launcher.html">
                    <span class="en">Launcher Icons <span class="new">updated</span></span>
                  </a></li>
              <li><a href="../../../guide/practices/ui_guidelines/icon_design_menu.html">
                    <span class="en">Menu Icons</span>
                  </a></li>
              <li><a href="../../../guide/practices/ui_guidelines/icon_design_action_bar.html">
                    <span class="en">Action Bar Icons <span class="new">new!</span></span>
                  </a></li>
              <li><a href="../../../guide/practices/ui_guidelines/icon_design_status_bar.html">
                    <span class="en">Status Bar Icons <span class="new">updated</span></span>
                  </a></li>
              <li><a href="../../../guide/practices/ui_guidelines/icon_design_tab.html">
                    <span class="en">Tab Icons</span>
                  </a></li>
              <li><a href="../../../guide/practices/ui_guidelines/icon_design_dialog.html">
                    <span class="en">Dialog Icons</span>
                  </a></li>
              <li><a href="../../../guide/practices/ui_guidelines/icon_design_list.html">
                    <span class="en">List View Icons</span>
                  </a></li>
            </ul>
          </li>
          <li><a href="../../../guide/practices/ui_guidelines/widget_design.html">
                <span class="en">App Widget Design <span class="new">updated</span></span>
              </a></li>
          <li><a href="../../../guide/practices/ui_guidelines/activity_task_design.html">
                <span class="en">Activity and Task Design</span>
              </a></li>
          <li><a href="../../../guide/practices/ui_guidelines/menu_design.html">
                <span class="en">Menu Design</span>
              </a></li>
        </ul>
      </li>
      </ul>
      <ul>
      <li><a href="../../../guide/practices/design/accessibility.html">
            <span class="en">Designing for Accessibility</span>
          </a></li>
      <li class="toggle-list">
        <div><a href="../../../guide/practices/design/performance.html">
            <span class="en">Designing for Performance</span>
          </a></div>
        <ul>
          <li><a href="../../../guide/practices/design/jni.html">
                <span class="en">JNI Tips</span>
              </a></li>
        </ul>
      </li>
      <li><a href="../../../guide/practices/design/responsiveness.html">
            <span class="en">Designing for Responsiveness</span>
          </a></li>
      <li><a href="../../../guide/practices/design/seamlessness.html">
            <span class="en">Designing for Seamlessness</span>
          </a></li>
    </ul>
  </li>

  <li>
    <h2><span class="en">Web Applications</span>
    </h2>
    <ul>
      <li><a href="../../../guide/webapps/index.html">
            <span class="en">Web Apps Overview</span>
          </a></li>
      <li><a href="../../../guide/webapps/targeting.html">
            <span class="en">Targeting Screens from Web Apps</span>
          </a></li>
      <li><a href="../../../guide/webapps/webview.html">
            <span class="en">Building Web Apps in WebView</span>
          </a></li>
      <li><a href="../../../guide/webapps/debugging.html">
            <span class="en">Debugging Web Apps</span>
          </a></li>
      <li><a href="../../../guide/webapps/best-practices.html">
            <span class="en">Best Practices for Web Apps</span>
          </a></li>
    </ul>
  </li>

  <li>
    <h2><span class="en">Appendix</span>
               <span class="de" style="display:none">Anhang</span>
               <span class="es" style="display:none">Apéndice</span>
               <span class="fr" style="display:none">Annexes</span>
               <span class="it" style="display:none">Appendice</span>
               <span class="ja" style="display:none">付録</span>
               <span class="zh-CN" style="display:none">附录</span>
               <span class="zh-TW" style="display:none">附錄</span>
    </h2>
    <ul>
      <li><a href="../../../guide/appendix/api-levels.html">
            <span class="en">Android API Levels</span>
          </a></li>
      <li><a href="../../../guide/appendix/install-location.html">
            <span class="en">App Install Location</span>
          </a></li>
      <li><a href="../../../guide/appendix/media-formats.html">
            <span class="en">Supported Media Formats <span class="new">updated</span></span>
          </a></li>
      <li><a href="../../../guide/appendix/g-app-intents.html">
            <span class="en">Intents List: Google Apps</span>
          </a></li>
      <li><a href="../../../guide/developing/tools/aidl.html">AIDL</a></li>
      <li><a href="../../../guide/appendix/glossary.html">
            <span class="en">Glossary</span>
          </a></li>
    </ul>
  </li>

</ul>

<script type="text/javascript">
<!--
    buildToggleLists();
    changeNavLang(getLangPref());
//-->
</script>

      </div>
    </div> <!-- end side-nav -->
    <script>
      addLoadEvent(function() {
        scrollIntoView("devdoc-nav");
        });
    </script>




<div class="g-unit" id="doc-content"><a name="top"></a>

<div id="jd-header" class="guide-header">
  <span class="crumb">
    &nbsp;
    
  </span>
<h1>Multiple APK Support</h1>
</div>

  <div id="jd-content">

    <div class="jd-descr">
    <div id="qv-wrapper">
<div id="qv">

  <h2>Quickview</h2>
  <ul>
    <li>Simultaneously publish different APKs for different
device configurations</li>
    <li>Different APKs are distributed to different devices based on filters declared in the
manifest file</li>
    <li>You should publish multiple APKs only when it's not possible or reasonable to
support all desired devices with a single APK</li>
  </ul>

  <h2>In this document</h2>
<ol>
  <li><a href="#Concepts">Publishing Concepts</a>
    <ol>
      <li><a href="#Active">Active APKs</a></li>
      <li><a href="#SimpleAndAdvanced">Simple mode and advanced mode</a></li>
    </ol>
  </li>
  <li><a href="#HowItWorks">How Multiple APKs Work</a>
    <ol>
      <li><a href="#SupportedFilters">Supported filters</a></li>
      <li><a href="#Rules">Rules for multiple APKs</a></li>
    </ol>
  </li>
  <li><a href="#CreatingApks">Creating Multiple APKs</a>
    <ol>
      <li><a href="#VersionCodes">Assigning version codes</a></li>
    </ol>
  </li>
  <li><a href="#SingleAPK">Using a Single APK Instead</a>
    <ol>
      <li><a href="#TextureOptions">Supporting multiple GL textures</a></li>
      <li><a href="#ScreenOptions">Supporting multiple screens</a></li>
      <li><a href="#ApiLevelOptions">Supporting multiple API levels</a></li>
    </ol>
  </li>
</ol>

  <h2>See also</h2>
<ol>
  <li><a href="../../../guide/appendix/market-filters.html">Market Filters</a></li>
  <li><a href="../../../guide/practices/screens_support.html">Supporting Multiple Screens</a></li>
  <li><a href="../../../sdk/compatibility-library.html">Compatibility
Package</a></li>
  <li><a href="../../../guide/appendix/api-levels.html">Android API Levels</a></li>
</ol>

</div>
</div>

<p>Multiple APK support is a feature in Android Market that allows you to publish different APKs
for your application that are each targeted to different device configurations. Each APK is a
complete and independent version of your application, but they share the same application listing on
Android Market and must share the same package name and be signed with the same release key. This
feature is useful for cases in which your application cannot reach all desired devices with a single
APK.</p>

<p>Android-powered devices may differ in several ways and it's important
to the success of your application that you make it available to as many devices as possible.
Android applications usually run on most compatible devices with a single APK, by supplying
alternative resources for different configurations (for example, different layouts for different
screen sizes) and the Android system selects the appropriate resources for the device at runtime. In
a few cases, however, a single APK is unable to support all device configurations, because
alternative resources make the APK file too big (greater than 50MB) or other technical challenges
prevent a single APK from working on all devices.</p>

<p>Although <strong>we encourage you to develop and publish a single APK</strong> that supports as
many device configurations as possible, doing so is sometimes not possible. To help
you publish your application for as many devices as possible, Android Market allows you to
publish multiple APKs under the same application listing. Android Market then supplies each APK to
the appropriate devices based on configuration support you've declared in the manifest file of each
APK.</p>

<p>By publishing your application with multiple APKs, you can:</p>

<ul>
  <li>Support different OpenGL texture compression formats with each APK.</li>
  <li>Support different screen configurations with each APK.</li>
  <li>Support different platform versions with each APK.</li>
</ul>

<p>Currently, these are the only device characteristics that Android Market supports for publishing
multiple APKs as the same application.</p>

<p class="note"><strong>Note:</strong> You should generally use multiple APKs to support
different device configurations <strong>only when your APK is too large</strong> (greater than
50MB). Using a single APK to support different configurations is always the best practice,
because it makes the path for application updates simple and clear for users (and also makes
your life simpler by avoiding development and publishing complexity). Read the section below about
<a href="#SingleAPK">Using a Single APK Instead</a> to
consider your options before publishing multiple APKs.</p>


<h2 id="Concepts">Publishing Concepts</h2>

<p>Before you start publishing multiple APKs on Android Market, you must understand a few
concepts regarding how the Android Market publisher site works.</p>

<h3 id="Active">Active APKs</h3>

<div class="sidebox-wrapper">
<div class="sidebox">
  <h4>The difference between "Publish" and "Save"</h4>
  <p>When editing your application, there are two buttons on the top-right side of the page. The
first button is either <strong>Publish</strong> or <strong>Unpublish</strong> and the second
button is always <strong>Save</strong> (but its behavior changes).</p>
  <p>When your application is new or you have unpublished it from Market, the first
button says <strong>Publish</strong>. Clicking it will publish any APKs listed as
Active, making them available on Android Market. Also while your application is new
or unpublished, clicking <strong>Save</strong> will save any changes you've made, such
as information added to the Product details and APKs you've uploaded, but nothing is made visible on
Android Market&mdash;this allows you to save your changes and sign out of the publisher site before
deciding to publish.</p>
 <p>Once you've published your application, the first button changes to
<strong>Unpublish</strong>. Clicking it in this state unpublishes your application so that none
of the APKs are available on Android Market. Also while published, the behavior of the
<strong>Save</strong> button is different. In this state, clicking <strong>Save</strong> not
only saves all your changes, but also publishes them to Android Market. For example, if you've
already published your application and then make changes to your product details or activate new
APKs, clicking <strong>Save</strong> makes all those changes live on Android Market.</p>
</div>
</div>


<p>Before you can publish your application (whether publishing one or multiple APKs), you
must "activate" your APK(s) from the <strong>APK files</strong> tab. When you activate an APK, it
moves into the list of <em>Active</em> APKs. This list allows you to preview which APK(s)
you're about to publish.</p>

<p>If there are no errors, any "active" APK will be published to
Android Market when you click the <strong>Publish</strong> button (if the application is
unpublished) or when you click the <strong>Save</strong> button (if the application is
already published).</p>


<h3 id="SimpleAndAdvanced">Simple mode and advanced mode</h3>

<p>The Android Market publisher site provides two modes for managing the APKs associated with
your application: <em>simple mode</em> and <em>advanced mode</em>. You can switch between these by
clicking the
link at the top-right corner of the <strong>APK files</strong> tab.</p>

<p>Simple mode is the traditional way to publish an application, using one APK at a time. In
simple mode, only one APK can be activated at a time. If you upload a new APK to update
the application, clicking "Activate" on the new APK deactivates the currently
active APK (you must then click <strong>Save</strong> to publish the new APK).</p>

<p>Advanced mode allows you to activate and publish multiple APKs that are each designed for a
specific set of device configurations. However, there are several rules based on the manifest
declarations in each APK that determine whether you're allowed to activate each APK along with
others. When you activate an APK and it violates one of the rules, you will receive an error or
warning message. If it's an error, you cannot publish until you resolve the problem; if it's a
warning, you can publish the activated APKs, but there might be unintended consequences as to
whether your application is available for different devices. These rules are discussed more
below.</p>


<h2 id="HowItWorks">How Multiple APKs Work</h2>

<p>The concept for using multiple APKs on Android Market is that you have just one entry in
Android Market for your application, but different devices might download a different APK. This
means that:</p>

<ul>
  <li>You maintain only one set of product details (app description, icons, screenshots, etc.).
This also means you <em>cannot</em> charge a different price for different APKs.</li>
  <li>All users see only one version of your application on Android Market, so they are not
confused by different versions you may have published that are "for tablets" or
"for phones."</li>
  <li>All user reviews are applied to the same application listing, even though users on different
devices may have different APKs.</li>
  <li>If you publish different APKs for different versions of Android (for different API levels),
then when a user's device receives a system update that qualifies them for a different APK you've
published, Android Market updates the user's application to the APK designed for the higher version
of Android. Any system data associated with the application is retained (the same as with normal
application updates when using a single APK).</li>
</ul>

<p>To publish multiple APKs for the same application, you must enable <strong>Advanced mode</strong>
in your application's <strong>APK files</strong> tab (as discussed in the previous section). Once
in advanced mode, you can upload, activate, then publish multiple APKs for the same application. The
following sections describe more about how it works.</p>


<h3 id="SupportedFilters">Supported filters</h3>

<p>Which devices receive each APK is determined by <a
href="../../../guide/appendix/market-filters.html">Android Market filters</a> that are specified by
elements in the manifest file of each APK. However, Android Market allows you to publish multiple
APKs only when each APK uses filters to support a variation of the following
device characteristics:</p>

<ul>
  <li><strong>OpenGL texture compression formats</strong>
    <p>This is based on your manifest file's <a
href="../../../guide/topics/manifest/supports-gl-texture-element.html"><code>&lt;supports-gl-texture&gt;</code></a> element(s).</p>
    <p>For example, when developing a game that uses OpenGL ES, you can provide one APK for
devices that support ATI texture compression and a separate APK for devices
that support PowerVR compression (among many others).</p>
  <br/>
  </li>

  <li><strong>Screen size (and, optionally, screen density)</strong>
    <p>This is based on your manifest file's <a
href="../../../guide/topics/manifest/supports-screens-element.html"><code>&lt;supports-screens&gt;</code></a> <em>or</em> <a
href="../../../guide/topics/manifest/compatible-screens-element.html"><code>&lt;compatible-screens&gt;</code></a> element. You should never use both elements and you should use only
<a href="../../../guide/topics/manifest/supports-screens-element.html"><code>&lt;supports-screens&gt;</code></a> when possible.</p>
    <p>For example, you can provide one APK that supports small and normal size screens and another
APK that supports large and xlarge screens.</p>

    <p class="note"><strong>Note:</strong> The Android system provides strong support for
applications to support all screen configurations with a single APK. You should avoid creating
multiple APKs to support different screens unless absolutely necessary and instead follow the guide
to <a href="../../../guide/practices/screens_support.html">Supporting Multiple
Screens</a> so that your application is flexible and can adapt to all screen configurations
with a single APK.</p>
    <p class="caution"><strong>Caution:</strong> By default, all screen size attributes in the <a
href="../../../guide/topics/manifest/supports-screens-element.html"><code>&lt;supports-screens&gt;</code></a> element are "true" if you do not declare them otherwise. However,
because the <code>android:xlargeScreens</code> attribute was added in Android 2.3 (API level
9), Android Market will assume that it is "false" if your application does not set either <a
href="../../../guide/topics/manifest/uses-sdk-element.html#min"><code>android:minSdkVersion</code></a> or <a
href="../../../guide/topics/manifest/uses-sdk-element.html#target"><code>android:targetSdkVersion</code></a> to "9" or higher.</p>
    <p class="caution"><strong>Caution:</strong> You should not combine both <a
href="../../../guide/topics/manifest/supports-screens-element.html"><code>&lt;supports-screens&gt;</code></a> and <a
href="../../../guide/topics/manifest/compatible-screens-element.html"><code>&lt;compatible-screens&gt;</code></a> elements in your manifest file. Using both increases the chances
that you'll introduce an error due to conflicts between them. For help deciding which to use, read
<a href="../../../guide/practices/screens-distribution.html">Distributing to Specific Screens</a>.
If you can't avoid using both, be aware that for any conflicts in agreement between a given size,
"false" will win.</p>
  <br/>
  </li>

  <li><strong>API level</strong>
    <p>This is based on your manifest file's <a
href="../../../guide/topics/manifest/uses-sdk-element.html"><code>&lt;uses-sdk&gt;</code></a> element.
You
can use both the <a href="../../../guide/topics/manifest/uses-sdk-element.html#min"><code>android:minSdkVersion</code></a> and <a
href="../../../guide/topics/manifest/uses-sdk-element.html#max"><code>android:maxSdkVersion</code></a>
attributes to specify support for different API levels.</p>
    <p>For example, you can publish your application with one APK that supports API levels 4 - 7
(Android 1.6 - 2.1)&mdash;using only APIs available since API level 4 or lower&mdash;and another
APK that supports API levels 8 and above (Android 2.2+)&mdash;using APIs available since API level 8
or lower.</p>
    <div class="note">
      <p><strong>Note:</strong></p>
      <ul>
        <li>If you use this characteristic as the factor to distinguish multiple APKs, then the APK
with a higher <a href="../../../guide/topics/manifest/uses-sdk-element.html#min"><code>android:minSdkVersion</code></a> value must have a higher <a
href="../../../guide/topics/manifest/manifest-element.html#vcode"><code>android:versionCode</code></a>
value. This is also true if two APKs overlap their device support based on a different supported
filter. This ensures that when a device receives a system update, Android Market can offer the user
an update for your application (because updates are based on an increase in the app version code).
This requirement is described further in the section below about <a href="#Rules">Rules for
multiple APKs</a>.</li>
        <li>You should avoid using <a
href="../../../guide/topics/manifest/uses-sdk-element.html#max"><code>android:maxSdkVersion</code></a> in general, because as long as you've properly developed your
application with public APIs, it is always compatible with future versions of Android. If you want
to publish a different APK for higher API levels, you still do not need to specify the
maximum version, because if the <a
href="../../../guide/topics/manifest/uses-sdk-element.html#min"><code>android:minSdkVersion</code></a> is <code>"4"</code> in one APK and <code>"8"</code> in another, devices that
support API level 8 or higher will always receive the second APK (because it's version code is
higher, as per the previous note).</li>
    </ul>
  </div>
  </li>
</ul>

<p>Other manifest elements that enable <a
href="../../../guide/appendix/market-filters.html">Android Market filters</a>&mdash;but are not
listed above&mdash;are still applied for each APK as usual. However, Android Market does not allow
you to publish multiple APKs based on variations of them. Thus, you cannot publish
multiple APKs if the above listed filters are the same for each APK (but the APKs differ based on
other characteristics in the manifest file). For
example, you cannot provide different APKs that differ purely on the <a
href="../../../guide/topics/manifest/uses-configuration-element.html"><code>&lt;uses-configuration&gt;</code></a> characteristics.</p>



<h3 id="Rules">Rules for multiple APKs</h3>

<p>Before you enable advanced mode to publish multiple APKs for your application, you need to
understand the following rules that define how publishing multiple APKs works:</p>

<ul>
  <li>All APKs you publish for the same application <strong>must have the same package
name and be signed with the same certificate key</strong>.</li>

  <li>Each APK <strong>must have a different version code</strong>, specified by the
<a href="../../../guide/topics/manifest/manifest-element.html#vcode"><code>android:versionCode</code></a> attribute.</li>

  <li>Each APK <strong>must not exactly match the configuration support of another APK</strong>.
    <p>That is, each APK must declare slightly different support for at least one of
the <a href="#MarketFiltersSupported">supported Market filters</a> (listed above).</p>
    <p>Usually, you will differentiate your APKs based on a specific characteristic (such as the
supported texture compression formats), and thus, each APK will declare support for different
devices. However, it's OK to publish multiple APKs that overlap their support slightly. When two
APKs do overlap (they support some of the same device configurations), a device that falls within
that overlap range will receive the APK with a higher version code (defined by <a
href="../../../guide/topics/manifest/manifest-element.html#vcode"><code>android:versionCode</code></a>).</p></li>

  <li>You cannot activate a new APK that has a version code lower than that of the APK it's
replacing. For example, say you have an active APK for screen sizes small - normal with version code
0400, then try to replace it with an APK for the same screen sizes with version code 0300. This
raises an error, because it means users of the previous APK will not be able to update the
application.</li>

  <li>An APK that requires a <strong>higher API level</strong> must have a <strong>higher
version code</strong>.
    <p>This is true only when either: the APKs differ based <em>only</em> on the
supported API levels (no other <a href="#SupportedMarketFilters">supported market filters</a>
distinguish the APKs from each other) <em>or</em> when the APKs do use another supported filter, but
there is an overlap between the APKs within that filter.</p>
    <p>This is important because a user's device receives an application update from
Android Market only if the version code for the APK on Android Market is higher than the version
code of the APK currently on the device. This ensures that if a device receives a system update that
then qualifies it to install the APK for higher API levels, the device receives an application
update because the version code increases.</p>
<p class="note"><strong>Note:</strong> The size of the version code increase is irrelevant; it
simply needs to be larger in the version that supports higher API levels.</p>
    <p>Here are some examples:</p>
    <ul>
      <li>If an APK you've uploaded for API levels 4 and above (Android 1.6+) has a version code of
<code>0400</code>, then an APK for API levels 8 and above (Android 2.2+) must be <code>0401</code> or
greater. In this case, the API level is the only supported filter used, so the version codes
<strong>must increase</strong> in correlation with the API level support for each APK, so that users
get an update when they receive a system update.</li>
      <li>If you have one APK that's for API level 4 (and above) <em>and</em> small -
large screens, and another APK for API level 8 (and above) <em>and</em> large - xlarge screens, then
the version codes <strong>must increase</strong>. In this case, the API level filter is used to
distinguish each APK, but so is the screen size. Because the screen sizes overlap (both APKs
support large screens), the version codes must still be in order. This ensures that a large screen
device that receives a system update to API level 8 will receive an update for the second
APK.</li>
      <li>If you have one APK that's for API level 4 (and above) <em>and</em> small -
normal screens, and another APK for API level 8 (and above) <em>and</em> large - xlarge
screens, then the version codes <strong>do not need to increase</strong> in correlation with the API
levels. Because there is no overlap within the screen size filter, there are no devices that
could potentially move between these two APKs, so there's no need for the version codes to
increase from the lower API level to the higher API level.</li>
    </ul>
  </li>

</ul>

<p>Failure to abide by the above rules results in an error on the Android Market publisher site
when you activate your APKs&mdash;you will be unable to publish your application until you
resolve the error.</p>

<p>There are other conflicts that might occur when you activate your APKs, but which will result
in warnings rather than errors. Warnings can be caused by the following:</p>

<ul>
  <li>When you modify an APK to "shrink" the support for a device's characteristics and no other
APKs support the devices that then fall outside the supported range. For example, if an APK
currently supports small and normal size screens and you change it to support only small screens,
then you have shrunk the pool of supported devices and some devices will no longer see your
application in Android Market. You can resolve this by adding another APK that supports normal size
screens so that all previously-supported devices are still supported.</li>

  <li>When there are "overlaps" between two or more APKs. For example, if an APK supports screen
sizes small, normal, and large, while another APK supports sizes large and xlarge, there is an
overlap, because both APKs support large screens. If you do not resolve this, then devices that
qualify for both APKs (large screen devices in the example) will receive whichever APK has the
highest version code.</li>
</ul>

<p>When such conflicts occur, you will see a warning message, but you can still publish your
application.</p>



<h2 id="CreatingApks">Creating Multiple APKs</h2>

<p>Once you decide to publish multiple APKs, you probably need to create separate
Android projects for each APK you intend to publish so that you can appropriately develop them
separately. You can do this by simply duplicating your existing project and give it a new name.
(Alternatively, you might use a build system that can output different resources&mdash;such
as textures&mdash;based on the build configuration.)</p>

<p class="note"><strong>Tip:</strong> One way to avoid duplicating large portions of your
application code is to use a <a
href="../../../guide/developing/projects/index.html#LibraryProjects">library project</a>. A library
project holds shared code and resources, which you can include in your actual application
projects.</p>

<p>When creating multiple projects for the same application, it's a good practice to identify each
one with a name that indicates the device restrictions to be placed on the APK, so you can
easily identify them. For example, "HelloWorld_8" might be a good name for an
application designed for API level 8 and above.</p>

<p class="note"><strong>Note:</strong> All APKs you publish for the same application
<strong>must have the same package name and be signed with the same certificate key</strong>. Be
sure you also understand each of the <a href="#Rules">Rules for multiple APKs</a>.</p>


<h3 id="VersionCodes">Assigning version codes</h3>

<p>Each APK for the same application <strong>must have a unique version code</strong>, specified by
the <a href="../../../guide/topics/manifest/manifest-element.html#vcode"><code>android:versionCode</code></a> attribute. You must be careful about assigning version codes when
publishing multiple APKs, because they must each be different, but in some
cases, must or should be defined in a specific order, based on the configurations that each APK
supports.</p>

<h4>Ordering version codes</h4>

<p>An APK that requires a higher API level must usually have a higher version code. For example, if
you create two APKs to support different API levels, the APK for the higher API levels must have the
higher version code. This ensures that if a device receives a system update that then qualifies it
to install the APK for higher API levels, the user receives a notification to update the app. For
more information about how this requirement applies, see the section above about <a
href="#Rules">Rules for multiple APKs</a>.</p>

<p>You should also consider how the order of version codes might affect which APK your users
receive either due to overlap between coverage of different APKs or future changes you might make to
your APKs.</p>

<p>For example, if you have different APKs based on screen size, such as one for small - normal and
one for large - xlarge, but foresee a time when you will change the APKs to be one for small and one
for normal - xlarge, then you should make the version code for the large - xlarge APK be higher.
That way, a normal size device will receive the appropriate update when you make the change, because
the version code increases from the existing APK to the new APK that now supports the device. </p>

<p>Also, when creating multiple APKs that differ based on support for different OpenGL texture
compression formats, be aware that many devices support multiple formats. Because a device
receives the APK with the highest version code when there is an overlap in coverage between two
APKs, you should order the version codes among your APKs so that the APK with the
preferred compression format has the highest version code. For example, you might want to perform
separate builds for your app using PVRTC, ATITC, and ETC1 compression formats. If you prefer these
formats in this exact order, then the APK that uses PVRTC should have the highest version code, the
APK that uses ATITC has a lower version code, and the version with ETC1 has the lowest. Thus, if a
device supports both PVRTC and ETC1, it receives the APK with PVRTC, because it has the highest
version code.</p>


<h4>Using a version code scheme</h4>

<p>In order to allow different APKs to update their version codes independent of others (for
example, when you fix a bug in only one APK, so don't need to update all APKs), you should use a
scheme for your version codes that
provides sufficient room between each APK so that you can increase the code in one without requiring
an increase in others. You should also include your actual version name in the code (that is, the
user visible version assigned to <a
href="../../../guide/topics/manifest/manifest-element.html#vname"><code>android:versionName</code></a>),
so that it's easy for you to associate the version code and version name.</p>

<p class="note"><strong>Note:</strong> When you increase the version code for an APK, Android
Market will prompt users of the previous version to update the application. Thus, to avoid
unnecessary updates, you should not increase the version code for APKs that do not actually
include changes.</p>

<p>We suggest using a version code with at least 7 digits: integers that represent
the supported configurations are in the higher order bits, and the version name (from <a
href="../../../guide/topics/manifest/manifest-element.html#vname"><code>android:versionName</code></a>) is in the lower order bits. For example, when the application version
name is 3.1.0, version codes for an API level 4
APK and an API level 11 APK would be something like 0400310 and 1100310, respectively. The first
two digits are reserved for the API Level (4 and 11, respectively), the middle two digits are for
either screen sizes or GL texture formats (not used in these examples), and the last three digits
are for the application's version name (3.1.0). Figure 1 shows two examples that split based on both
the platform version (API Level) and screen size.</p>

<img src="../../../images/market/version-codes.png" alt="" />
<p class="img-caption"><strong>Figure 1.</strong> A suggested scheme for your version codes,
using the first two digits for the API Level, the second and third digits for the minimum and
maximum screen size (1 - 4 indicating each of the four sizes) or to denote the texture formats
and the last three digits for the app version.</p>

<p>This scheme for version codes is just a suggestion for how you should establish a
pattern that is scalable as your application evolves. In particular, this scheme doesn't
demonstrate a solution for identifying different texture compression formats. One option might be
to define your own table that specifies a different integer to each of the different
compression formats your application supports (for example, 1 might correspond to ETC1 and 2 is
ATITC, and so on).</p>

<p>You can use any scheme you want, but you should carefully consider how future versions of your
application will need to increase their version codes and how devices can receive updates when
either the device configuration changes (for example, due to a system update) or when you modify the
configuration support for one or several of the APKs.</p>




<h2 id="SingleAPK">Using a Single APK Instead</h2>

<p><strong>Creating multiple APKs for your application is not the normal procedure</strong> for
publishing an application on Android Market. In most cases, you should be able to publish your
application to most users with a single APK and we encourage that you do so. When you encounter
a situation in which using a single APK becomes difficult, you should carefully consider all your
options before deciding to publish multiple APKs.</p>

<p>First of all, there are a few key benefits to developing a single APK that supports all
devices:</p>

<ul>
  <li><strong>Publishing and managing your application is easier.</strong>
    <p>With only one APK to worry about at any given time, you're less likely to become confused by
which APK is what. You also don't have to keep track of multiple version codes for each
APK&mdash;by using only one APK, you can simply increase the version code with each release and
be done.</p>  </li>
  <li><strong>You need to manage only a single code base.</strong>
    <p>Although you can use a <a
href="../../../guide/developing/projects/index.html#LibraryProjects">library project</a>
to share code between multiple Android projects, it's still likely that you'll reproduce some code
across each project and this could become difficult to manage, especially when resolving
bugs.</p></li>
  <li><strong>Your application can adapt to device configuration changes.</strong>
    <p>By creating a single APK that contains all the resources for each device configuration, your
application can adapt to configuration changes that occur at runtime. For example, if the user docks
or otherwise connects a handset device to a larger screen, there's a chance that this will invoke a
system configuration change to support the larger screen. If you include all resources for different
screen configurations in the same APK, then your application will load alternative resources and
optimize the user experience for the new interface.</p>
  </li>
  <li><strong>App restore across devices just works.</strong>
    <p>If a user has enabled data backup on his or her current device and then buys a new device
that has a different configuration, then when the user's apps are automatically restored during
setup, the user receives your application and it runs using the resources optimized for that device.
For example, on a new tablet, the user receives your application and it runs with your
tablet-optimized resources. This restore
process does not work across different APKs, because each APK can potentially have different
permissions that the user has not agreed to, so Android Market may not restore the application at
all. (If you use multiple APKs, the user receives either the exact same APK if it's compatible or
nothing at all and must manually download your application to get the APK designed for the new
device.)</p></li>
</ul>

<p>The following sections describe some of the other options you should use to support multiple
device configurations before deciding to publish multiple APKs.</p>



<h3 id="TextureOptions">Supporting multiple GL textures</h3>

<p>To support multiple types of GL textures with a single APK, your application should query the GL
texture formats supported on the device and then use the appropriate resources or download
them from a web server. For example, in order to keep the size of your APK small, you can query the
device's support for different GL texture formats when the application starts for the first time and
then download only the textures you need for that device.</p>

<p>For maximum performance and compatibility, your application should use ETC1 textures wherever it
doesn't impact the visual quality. However, because ETC1 cannot deal with images that have drastic
chroma changes, such as line art and (most) text, and doesn't support alpha, it may not the best
format for all textures.</p>

<p>With a single APK, you should try to use ETC1 textures and uncompressed textures whenever
reasonable, and consider the use of PVRTC, ATITC, or DXTC as a last resort when ETC1 does not
suffice.</p>

<p>Here's an example query for supported texture compression formats from inside a
<code><a href="../../../reference/android/opengl/GLSurfaceView.Renderer.html">GLSurfaceView.Renderer</a></code>:</p>

<pre>
public void onSurfaceChanged(GL10 gl, int w, int h) {
    String extensions = gl.glGetString(GL10.GL_EXTENSIONS);
    Log.d("ExampleActivity", extensions);
}
</pre>

<p>This returns a string that lists each of the supported compression formats.</p>



<h3 id="ScreenOptions">Supporting multiple screens</h3>

<p>Unless your APK file exceeds the Android Market size limit of 50MB, supporting multiple screens
should always be done with a single APK. Since Android 1.6, the Android system manages most of the
work required for your application to run successfully on a variety of screen sizes and
densities.</p>

<p>To further optimize your application for different screen sizes and densities, you should provide
<a href="../../../guide/topics/resources/providing-resources.html#AlternativeResources">alternative
resources</a> such as bitmap drawables at different resolutions and different layout designs for
different screen sizes.</p>

<p>For more information about how to support multiple screens with a single APK, read <a
href="../../../guide/practices/screens_support.html">Supporting Multiple Screens</a>.</p>

<p>Additionally, you should consider using a support library from the <a
href="../../../sdk/compatibility-library.html">Compatibility Package</a> so that you can add <a
href="../../../guide/topics/fundamentals/fragments.html">Fragments</a> to your activity designs
when running on larger screens such as tablets.</p>



<h3 id="ApiLevelOptions">Supporting multiple API levels</h3>

<p>If you want to support as many versions of the Android platform as possible, you should use
only APIs available in the lowest reasonable version. For example, your application may not require
APIs newer than Android 2.1 (API Level 7), which makes an application available to
over 95% of Android-powered devices (as indicated by the <a
href="../../../resources/dashboard/platform-versions.html">Platform Versions</a> dashboard).</p>

<p>By using a support library from the <a
href="../../../sdk/compatibility-library.html">Compatibility Package</a>, you can also use APIs
from some of the latest versions (such as Android 3.0) while
still supporting versions as low as Android 1.6. The support library includes APIs for <a
href="../../../guide/topics/fundamentals/fragments.html">Fragments</a>, <a
href="../../../guide/topics/fundamentals/loaders.html">Loaders</a>, and more. Using the fragment
APIs is particularly valuable so that you can optimize your user interface for large devices such as
tablets.</p>

<p>Alternatively, if you want to use some APIs that are available only in newer versions of Android
(which your application can still function without), then you should consider using reflection. By
using reflection, you can check whether the current device supports certain APIs. If the APIs are
not available, your application can gracefully disable and hide the feature.</p>

<p>Another way to use new APIs only when running on a version that supports them is to check the
API level of the current device. That is, you can query the value of <code><a href="../../../reference/android/os/Build.VERSION.html#SDK_INT">SDK_INT</a></code> and create different code paths depending on the API level
supported by the device. For example:</p>

<pre>
if (android.os.Build.VERSION.SDK_INT >= 11) {
    // Use APIs supported by API level 11 (Android 3.0) and up
} else {
    // Do something different to support older versions
}
</pre>


    </div>

  <a href="#top" style="float:right">&uarr; Go to top</a>
  
  </div>

<div id="footer">


  <div id="copyright">
    
  Except as noted, this content is licensed under <a
  href="http://www.apache.org/licenses/LICENSE-2.0">Apache 2.0</a>. 
  For details and restrictions, see the <a href="../../../license.html">
  Content License</a>.
  </div>
  <div id="build_info">
    
  Android 4.0&nbsp;r1 - 17 Oct 2011 18:17

  </div>

  <div id="footerlinks">
    
  <p>
    <a href="http://www.android.com/terms.html">Site Terms of Service</a> -
    <a href="http://www.android.com/privacy.html">Privacy Policy</a> -
    <a href="http://www.android.com/branding.html">Brand Guidelines</a>
  </p>
  </div>

</div> <!-- end footer -->

</div><!-- end doc-content -->

</div> <!-- end body-content --> 

<script type="text/javascript">
init(); /* initialize android-developer-docs.js */
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-5831155-1");
pageTracker._trackPageview();
</script>

</body>
</html>



